﻿var app = angular.module('carApp', [
    'ngAnimate',
    'ngRoute',
    'toaster'
]);

app.config(['$routeProvider', '$httpProvider', function ($routeProvider, $httpProvider) {
    $routeProvider.when('/', {
        templateUrl: '/app/views/HomeView.html',
        controller: 'HomeController'
    })
    .when('/login', {
        templateUrl: '/app/views/LoginView.html',
        controller: 'LoginController'
    })
    .when('/cars', {
        templateUrl: '/app/views/CarView.html',
        controller: 'CarController'
    })
    .when('/createcar', {
        templateUrl: '/app/views/CreateCarView.html',
        controller: 'CarController'
    })
    .when('/search', {
        templateUrl: '/app/views/SearchView.html',
        controller: 'SearchController'
    })
    .otherwise({
        redirectTo: '/'
    });

    $httpProvider.interceptors.push('AuthFactory');
}]);